package jsptest;
import java.io.*;
import java.util.*;

public class invURL{
	private String arr_url;
	private static ArrayList<String> tokenizedData = new ArrayList<String>();
	private char splitc='?';

	public invURL(String data){
		this.arr_url=data;
	}
	public invURL(String data, char splitc){
		this.arr_url=data;
		this.splitc =splitc;
		split();
	}
	
	public Collection<String> split(){
		StringBuilder buf = new StringBuilder();
		
		for(int i=0;i<arr_url.length();++i){
			char c = arr_url.charAt(i);
			
			if(c==splitc){
				if(buf.length()>0){
					tokenizedData.add(buf.toString());
					buf.delete(0, buf.length());
				}
			}
		}
		return tokenizedData;
	}
	public static void main(String args[]){
		
		System.out.println(tokenizedData);
	}
}
